import { Injectable } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service';

@Injectable()
export class EditService {

	constructor(public httpClient: HttpClientService) { }
	// 获取附件树
	getFileTree(getBody) {
		return this.httpClient.get('/pms/v1/common/fundFile/attachTree', getBody);
  }
  //  公募编辑产品基础信息
	editBasic(item) {
		return this.httpClient.put('/pms/v1/publicissue/publicBasic', item);
	}
	// 附件删除
	delFile(putBody) {
		return this.httpClient.put('/pms/v1/common/fundFile/file/' + putBody);
	}
	// 获取附件历史版本
	getFileHistory(getBody) {
		return this.httpClient.get('/pms/v1/common/fundFile/versions/' + getBody);
	}
	// 修改附件名
	changeFileName(nAttachNo, newFileName) {
		return this.httpClient.put('/pms/v1/common/fundFile/file?nAttachNo=' + nAttachNo + '&attachName=' + newFileName);
	}
	// 创设新产品
	otmAddProduct(postBody) {
		return this.httpClient.post('/pms/v1/onetomany/oneToManyBasic', postBody);
	}
	// 一对一查询单个产品基础信息
	otoGetSingleProduct(nFundNo) {
		return this.httpClient.get('/pms/v1/oneOnOneFundInfo/basicInfo/' + nFundNo);
  }
  // 一对多查询单个产品基础信息
	otmGetSingleProduct(nFundNo) {
		return this.httpClient.get('/pms/v1/onetomany/oneToManyBasic/' + nFundNo);
  }
  // 公募查询单个产品基础信息
	pcGetSingleProduct(nFundNo) {
		return this.httpClient.get('/pms/v1/publicissue/publicBasic/' + nFundNo);
	}
	// 编辑产品基础信息
	otmEditProduct(putBody) {
		return this.httpClient.put('/pms/v1/onetomany/oneToManyBasic', putBody);
  }
  // 编辑产品基础信息
	otoEditProduct(putBody) {
		return this.httpClient.put('/pms/v1/oneOnOneFundInfo/basicInfo', putBody);
	}
	// 投资经理信息
	otmGetManager(getBody) {
		return this.httpClient.get('/pms/1/common/investManager/listPage', getBody);
	}
	// 产品业务类型,修改(1)、续约(2)、终止(3)、开始运作(4)
	operationType(putBody, businessType) {
		return this.httpClient.put('/pms/v1/onetomany/oneToManyBasicInfo?businessType=' + businessType, putBody);
	}
	// 判断产品审核状态,修改(1)、续约(2)、终止(3)、开始运作(4)
	checkProductStatus(nFundNo, sType) {
		return this.httpClient.get('/pms/v1/common/fundAudit/checkIsExit/' + nFundNo + '?sType=' + sType);
	}
}
